<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  </head>

  <body>
    <label for="max">最大值</label>
    <input type="text" id="max">
    <label for="min">最小值</label>
    <input type="text" id="min">
    <label for="number">生成数量</label>
    <input type="text" id="number">
    <button onclick="start()">生成</button>
    <div id="res">
      等待生成...
    </div>
    <script>
      function start(params) {
        // 不包含在内所以减去零点一
        const max = +document.querySelector('#max').value
        const min = +document.querySelector('#min').value
        const number = +document.querySelector('#number').value
        let html = ''
        for (let index = 0; index < number; index++) {
          const res = +((Math.random() * (max - min)) + min).toFixed(1)
          html += res + '<br/>'
        }
        document.querySelector('#res').innerHTML = html
      }
    </script>
  </body>

</html>
